<!DOCTYPE html>
<html lang="zh-CN">
@include('index.head')
<body>
@include('index.topNav')
@if(session('__Ajax_RedirectFunc_status') == true)
    <div>
        <div class="alert alert-success alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h3>成功</h3>
            <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
            <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
        </div>
    </div>
@endif
@if(session('__Ajax_RedirectFunc_status') === false)
    <div >
        <div class="alert alert-danger alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h3>失败</h3>
            <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
            <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
        </div>
    </div>
@endif

<div class="container">
    <div class="row">
        <div class="col-md-12" >
            <div class="col-md-5">
                <div class=" panel panel-default">
                    <div class="panel-body">
                        <h3>{{$serviceData->service_name}}</h3>
                        <br>
                        {{$serviceData->service_price}} 元/张
                        <br><br>
                        进入店铺：<a href="/shop/{{$serviceData->service_shop}}">{{$serviceData->shop_name}}</a><br><br>
                        地址：{{ $serviceData->shop_address }}<br><p></p>
                        <div id="mapContainer" style="width: 415px;height: 200px"></div>
                    </div>
                </div>
            </div>
            <div class="col-md-7">
                <div class=" panel panel-default">
                    <div class="panel-body">
                        <h1>服务介绍</h1>
                        <hr>
                        {!! $serviceData->service_info !!}
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <h4>下单</h4>
                        <hr>
                        <div class="col-md-12">
                            <form  enctype="multipart/form-data" class="form-horizontal" method="post" action="/toTask">
                                <input  type="hidden" name="_token" value="{{csrf_token()}}">
                                <input type="hidden" name="task_service" value="{{$serviceData->service_id}}">
                                <div class="form-group">
                                    <label>备注</label>
                                    <input type="text" class="form-control" name="task_info" placeholder="备注" >
                                </div>
                                <div class="form-group">
                                    <label>数量</label>
                                    <input type="text" class="form-control" name="task_num" placeholder="数量" >
                                </div>
                                <div class="form-group">
                                    <label>附件</label>
                                    <input type="file" name="files" >
                                    <small>请打包成压缩文件</small>
                                </div>
                                <button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#order">提交</button>
                                <div class="modal fade" id="order" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                                <h4 class="modal-title" id="myModalLabel2">扫码支付定金</h4>
                                            </div>
                                            <div class="modal-body">
                                                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                                <div style="text-align: center">
                                                    {!! QrCode::size(200)->encoding('UTF-8')->generate("{$serviceData->service_price}元") !!}<br>
                                                    <p>微信扫码付定金</p>
                                                </div>
                                            </div>
                                            <div class="modal-footer">
                                                <button type="submit" class="btn btn-success">支付</button>
                                                <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript"
        src="https://webapi.amap.com/maps?v=1.4.2&key=3d54bcb1eed23ed8bc14dad4e686892d"></script>
<script type="text/javascript">
    var map = new AMap.Map("mapContainer", {
        resizeEnable: true
    });
    AMap.service(["AMap.PlaceSearch"], function() {
        var placeSearch = new AMap.PlaceSearch({ //构造地点查询类
            pageSize: 5,
            pageIndex: 1,
            city: "{{ $serviceData->shop_city }}", //城市
            map: map//,
            //panel: "panel"
        });
        //关键字查询
        placeSearch.search('{{ $serviceData->shop_address }}', function(status, result) {
        });
    });
</script>
</html>